package com.maimang.platform;

import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
// import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RequestMapping;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * @author Rocky
 * @version 1.0.0
 * @类名 PlatformServletInitializer
 * @描述 <br>springboot主入口</br>
 * @日期 2018-12-04
 * @email jintaozhao@qq.com
 */
// @EnableEurekaClient
@ComponentScan(basePackages = {"com.maimang.platform.*"})
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, SecurityAutoConfiguration.class})
@MapperScan("com.maimang.platform.*.mapper")
@EnableCaching
@EnableSwaggerBootstrapUI
@EnableTransactionManagement
public class PlatformAdminApplication {

	@Value("${server.port}")
	private String port;

	@Value("${server.servlet.application-display-name}")
	private String appName;

	public static void main(String[] args) {
		SpringApplication.run(PlatformAdminApplication.class, args);
	}

	@RequestMapping("/")
	public String home() {
		return "Welcome to visit " + appName + ", and the port is " + port;
	}
}
